import Loading from "components/Loading/Loading";
import React from "react";
import { Suspense } from "react";
import { Route, RouteProps } from "react-router-dom";
import Loading from "@componets/Loading";


export const routes: RouteProps[] = [
    {
        path: '/',
        exct: true,
        component: Home
    }
];

const Routes: FC = () => {
    return (
        <Suspense fallback={<Loading />}>
            <Switch>
                {
                    routes.map((r, index) => {
                        const { path, exct, component } = r;
                        const LazyCom = component;
                        return (
                            <Route 
                                key={index}

                            />
                        )
                    })
                    <Route component={NotFound}></Route>
                }
            </Switch>
        </Suspense>
    )
}

export default Routes